﻿@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
    <title>H+ 后台主题UI框架 - 登录</title>
    <meta name="keywords" content="H+后台主题,后台bootstrap框架,会员中心主题,后台HTML,响应式后台">
    <meta name="description" content="H+是一个完全响应式，基于Bootstrap3最新版本开发的扁平化主题，她采用了主流的左右两栏式布局，使用了Html5+CSS3等现代技术">
    <link href="/Content/css/bootstrap.min.css" rel="stylesheet">
    <link href="/Content/css/font-awesome.min.css?v=4.4.0" rel="stylesheet">
    <link href="/Content/css/animate.min.css" rel="stylesheet">
    <link href="/Content/css/style.min.css" rel="stylesheet">
    <link href="/Content/css/login.min.css" rel="stylesheet">
    <!--[if lt IE 8]>
    <meta http-equiv="refresh" content="0;ie.html" />
    <![endif]-->
    <script>
        if(window.top!==window.self){window.top.location=window.location};
    </script>
</head>
<body class="signin">
    <div class="signinpanel">
        <div class="row">
            <div class="col-sm-7">
                <div class="signin-info">
                    <div class="logopanel m-b">
                        <h1>[ 康速测 ]</h1>
                    </div>
                    <div class="m-b"></div>
                    <h4>欢迎使用 <strong>H+ 后台主题UI框架</strong></h4>
                    <ul class="m-b">
                        <li><i class="fa fa-arrow-circle-o-right m-r-xs"></i> 优势一</li>
                        <li><i class="fa fa-arrow-circle-o-right m-r-xs"></i> 优势二</li>
                        <li><i class="fa fa-arrow-circle-o-right m-r-xs"></i> 优势三</li>
                        <li><i class="fa fa-arrow-circle-o-right m-r-xs"></i> 优势四</li>
                        <li><i class="fa fa-arrow-circle-o-right m-r-xs"></i> 优势五</li>
                    </ul>
                </div>
            </div>
            <div class="col-sm-5">
                <form id="form1">
                    <h4 class="no-margins">登录：</h4>
                    <p class="m-t-md">登录到H+后台主题UI框架</p>
                    <input type="text" name="loginName" id="loginName" class="form-control uname" placeholder="用户名" />
                    <input type="password" name="passWord" id="passWord" class="form-control pword m-b" placeholder="密码" />
                    <button type="button" id="login" class="btn btn-success btn-block">登录</button>
                </form>
            </div>
        </div>
        <div class="signup-footer">
            <div class="pull-left">
                &copy; 2016 All Rights Reserved. 微视点
            </div>
        </div>
    </div>
<script src="/Scripts/jquery-1.10.2.min.js"></script>
<script src="/Content/js/plugins/layer/layer.js"></script>
<script src="/Content/js/plugins/validate/jquery.validate.min.js"></script>
<script src="/Content/js/plugins/validate/messages_zh.min.js"></script>
<script type="text/javascript">
    $(function() {
        $("#login").click(function() {
            login();
        });
        document.onkeydown = function(e) {
            var ev = document.all ? window.event : e;
            if (ev.keyCode == 13) {
                login();
            }
        }
    });

    //提交登录
    function login() {
        if (validator.form()) {
            var loginName = $.trim($("#loginName").val());
            var passWord = $.trim($("#passWord").val());
            $.post("/Home/LoginValidate", { loginName: loginName, passWord: passWord }, function (json) {
                if (json.result == "success") {
                    //layer.msg("登录成功");
                    location.href = "/Home/Index";
                } else {
                    layer.msg(json.msg);
                }
            }, "json");
        }
    } 
    //验证
    var validator = $("#form1").validate({
        rules: {
            loginName: {
                required: true
            },
            passWord: {
                required: true,
                minlength: 6
            }
        },
        messages: {
            loginName: {
                required: "请输入用户名"
            },
            passWord: {
                required: "请输入密码",
                minlength: "密码长度不能小于 6 个字母"
            }
        }
    });


</script>

</body>
</html>